﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Data;

namespace YXShop.TemplateAction
{
    public partial class LabelParse
    {
        /// <summary>
        /// FS:LabelType=Other标签处理函数
        /// </summary>
        /// <returns></returns>
        public string Other()
        {
            string reStr = string.Empty;
            string mystyle = this.Label_Inserted;
            string str_Option = this.GetParamValue("YX:Option");

            if (!string.IsNullOrEmpty(str_Option))
            {
                YXShop.Common.SysParameter sp = new YXShop.Common.SysParameter();
                switch (str_Option)
                {
                    #region 用户登陆信息
                    case "LandSetup":
                        if (HttpContext.Current.Session["MemberName"] != null)
                        {
                            string ExitURL = Common.UrlStr("exitmembercenter", "", "membercenter/");
                            reStr = "您好，<span style='color:red'>" + HttpContext.Current.Session["MemberName"].ToString() + "</span>欢迎您回来!&nbsp;&nbsp;【<a href='" + ExitURL + "'>退出管理</a>】";
                        }
                        else
                        {
                            string LogingURL = Common.UrlStr("login", "", "membercenter/");
                            reStr += "您好，欢迎光临！开始购物之旅。  <a href=\"" + LogingURL + "\"><span>登陆</span></a>";
                            if (sp.IsRegistered)
                            {
                                string RegURL = Common.UrlStr("registered", "", "membercenter/");
                                reStr += "&nbsp;&nbsp;|&nbsp;&nbsp;<a href='" + RegURL + "'>免费注册</a>";
                            }
                        }
                        break;
                    case "Advertise":
                        if (!string.IsNullOrEmpty(mystyle))
                        {
                            reStr = "<script src=\"" + sp.DummyPaht + "include/advertise/" + mystyle + "\" type=\"text/jscript\"></script>";
                        }
                        break;
                    #endregion

                    #region 商品分类名称
                    case "ProductClassName":
                        YXShop.BLL.Product.Productclass classbll = new YXShop.BLL.Product.Productclass();
                        string ClassID = ChangeHope.Common.StringHelper.InputTexts(HttpContext.Current.Request.QueryString["q_cid"]);
                        if (ChangeHope.Common.ValidateHelper.IsNumber(ClassID))
                        {
                            YXShop.Model.Product.Productclass classmodel = classbll.GetModelID(Convert.ToInt32(ClassID));
                            string ShowValue = this.GetParamValue("YX:ShowValue");
                            if (ShowValue == "showname")
                            {
                                if (classmodel != null)
                                {
                                    reStr = classmodel.Name;
                                }
                            }
                            else if (ShowValue == "showupname")
                            {
                                classmodel = classbll.GetModelID(Convert.ToInt32(classmodel.Fatherid));
                                if (classmodel != null)
                                {
                                    reStr = classmodel.Name;
                                }
                                else
                                {
                                    reStr = "商品分类";
                                }
                            }
                        }
                        break;
                    #endregion

                    #region 商品属性
                    case "ProductProperty":
                        StringBuilder shtml = new StringBuilder();
                        if (ChangeHope.WebPage.PageRequest.GetQueryString("q_cid") != "")
                        {
                            string cid = ChangeHope.WebPage.PageRequest.GetQueryString("q_cid");
                            YXShop.BLL.Product.ProductPropery ppbll = new YXShop.BLL.Product.ProductPropery();
                            DataTable ppdt = ppbll.GetProperty(cid);
                            if (ppdt.Rows.Count > 0)
                            {
                                string Property = string.Empty;
                                string StyleName = "0d";
                                if (ChangeHope.WebPage.PageRequest.GetQueryString("q_property") != "")
                                {
                                    Property = ChangeHope.WebPage.PageRequest.GetQueryString("q_property");
                                }
                                int j = 1, f = 0;

                                for (int p = 0; p < ppdt.Rows.Count; p++)
                                {
                                    string Urlpar = string.Empty;
                                    string UrlparStr = string.Empty;
                                    if (!string.IsNullOrEmpty(Property))
                                    {
                                        UrlparStr = Property;
                                        string[] PropertyStr = Property.Split('|');
                                        for (int k = 0; k < PropertyStr.Length; k++)
                                        {
                                            if (PropertyStr[k].IndexOf(',') > -1)
                                            {
                                                string[] PropertyStrs = PropertyStr[k].Split(',');
                                                if (PropertyStrs[0] != string.Empty)
                                                {
                                                    if (PropertyStrs[0] == ppdt.Rows[p]["id"].ToString())
                                                    {
                                                        Urlpar = Property.Replace(PropertyStr[k], "");
                                                        Urlpar = Urlpar.Replace("$%||%", "$%");
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    if (!string.IsNullOrEmpty(Urlpar))
                                    {
                                        UrlparStr = Urlpar;
                                    }
                                    string Url = Common.URL("");
                                    if (!string.IsNullOrEmpty(UrlparStr))
                                    {
                                        Url = Common.URL("q_property=" + UrlparStr);
                                    }
                                    shtml.Append("<ul class=\"brand-xz2\"><li><span style=\"font-weight:bold;color:#000000;font-size:12px\">" + ppdt.Rows[p]["filed"].ToString() + "：</span><span id='Pro-" + j + "-0'  onmouseout=\"javascript:out('Pro-','" + j + "','0')\" onmousemove=\"javascript:move('Pro-','" + j + "','0')\" onclick=\"javascript:window.location.href='" + Url + "';\" style=\"cursor:hand\">全部</span></li>");
                                    int i = 1;
                                    foreach (string s in ppdt.Rows[p]["datavalue"].ToString().Split('\n'))
                                    {
                                        string ProName = s.Trim();
                                        string Urlpar1 = string.Empty;
                                        string UrlparStr1 = string.Empty;
                                        if (!string.IsNullOrEmpty(Property))
                                        {
                                            UrlparStr1 = Property;
                                            string[] PropertyStr = Property.Split('|');
                                            for (int k = 0; k < PropertyStr.Length; k++)
                                            {
                                                if (PropertyStr[k].IndexOf(',') > -1)
                                                {
                                                    string[] PropertyStrs = PropertyStr[k].Split(',');
                                                    if (PropertyStrs[0] != string.Empty)
                                                    {
                                                        if (PropertyStrs[0] == ppdt.Rows[p]["id"].ToString().ToString())
                                                        {
                                                            Urlpar1 = Property.Replace(PropertyStr[k], "" + ppdt.Rows[p]["id"].ToString() + ",%" + ProName + "%");
                                                        }
                                                    }

                                                }
                                            }
                                        }
                                        if (!string.IsNullOrEmpty(Urlpar1))
                                        {
                                            UrlparStr1 = Urlpar1;
                                        }
                                        else
                                        {
                                            UrlparStr1 += "$%|" + ppdt.Rows[p]["id"].ToString() + ",%" + ProName + "%|%";
                                        }
                                        string Url2 = Common.URL("q_property=" + UrlparStr1);

                                        shtml.Append("<li>");
                                        shtml.Append("<span id='Pro-" + j + "-" + i + "' class=\"" + StyleName + "\" style=\"cursor:hand\" onmouseout=\"javascript:out('Pro-','" + j + "','" + i + "')\" onmousemove=\"javascript:move('Pro-','" + j + "','" + i + "')\" onclick=\"javascript:window.location.href='" + Url2 + "';\">" + ProName + "</span>");
                                        shtml.Append("</li>");
                                        i++;
                                    }
                                    j++;
                                    f = j - 1;
                                    shtml.Append("<li><input id=\"Pro-" + f + "Value\" type=\"hidden\" value=\"\" /><input id=\"Pro-" + f + "PO\" type=\"hidden\" value=\"0\" /><input id=\"Pro-" + f + "TCount\" type=\"hidden\" value=\"" + i + "\" /></li></ul>");
                                }
                                shtml.Append("<input id=\"Pro-TRowCount\" type=\"hidden\" value=\"" + f + "\" />");
                            }
                            if (string.IsNullOrEmpty(shtml.ToString()))
                            {
                                shtml.Append("<ul class=\"brand-xz2\"><li>未找到相关筛选项。</li>");
                            }

                        }
                        else
                        {
                            shtml.Append("<ul class=\"brand-xz2\"><li>未找到相关筛选项。</li>");
                        }
                        reStr = shtml.ToString();
                        break;
                    #endregion

                    #region 导航条信息
                    case "ProductClassNav":
                        YXShop.BLL.Product.ProductClassNav data = new YXShop.BLL.Product.ProductClassNav();
                        ChangeHope.DataBase.DataByPage dataPage = data.GetList();

                        //添加表的内容
                        if (dataPage.DataReader != null)
                        {
                            int count = 0;

                            while (dataPage.DataReader.Read())
                            {
                                string style = "ProductClassNavStyle";
                                if (ChangeHope.WebPage.PageRequest.GetQueryString("q_cid") == dataPage.DataReader["nid"].ToString())
                                {
                                    style = "ProductClassNavStyles";
                                }
                                count++;
                                reStr += "<li class='" + style + "'><a href=\"" + Common.UrlStr("productlist", "q_cid=" + dataPage.DataReader["nid"].ToString() + "", "product/") + "\">" + dataPage.DataReader["name"].ToString() + "</a></li>";
                                if (count >= 5)
                                {
                                    break;
                                }
                            }
                        }
                        dataPage.Dispose();
                        dataPage = null;
                        break;
                    #endregion

                    #region 城市切换
                    case "SwitchStation":
                        if (sp.IsCloseStation)
                        {
                            YXShop.Common.Substation substation = new YXShop.Common.Substation();
                            reStr = "<font size=\"+1\"><strong>" + substation.CityName + "</strong></font><br><a href=# onClick=\"openWithIframe('选择城市','" + sp.DummyPaht + "controls/area.aspx',550,340);\" class=\"black\">切换城市</a>";
                        }
                        else
                        {
                            reStr = "<span style='color:#FFFFFF'>分站</span>";
                        }
                        break;
                    #endregion

                    #region 网站调查
                    case "WebSurvey":
                        YXShop.BLL.Accessories.Questionnaire bll = new YXShop.BLL.Accessories.Questionnaire();
                        List<YXShop.Model.Accessories.Questionnaire> list = bll.GetAll(" 1=1 and quest_appearance=1 order by quest_endtime desc");
                        for (int i = 0; i < list.Count; i++)
                        {
                            YXShop.BLL.Accessories.Question qbll = new YXShop.BLL.Accessories.Question();
                            List<YXShop.Model.Accessories.Question> qlist = qbll.GetAll(" 1=1 and questionId=" + list[i].Questid.ToString());

                            foreach (YXShop.Model.Accessories.Question q in qlist)
                            {
                                reStr += "<dt> <label style='cursor:hand' onClick=\"javascript:showorhidden(" + q.Id + ",'" + sp.DummyPaht + "')\">&nbsp;&nbsp;<b>" + q.QuestionContent + "</b></label><dt>";
                                reStr += "<table id='" + q.Id + "' style='display:block;width:96%' >";
                                if (q.QuestionType == 1 || q.QuestionType == 2)
                                {
                                    reStr += "<tr><td><input id='hd' name='hd" + q.Id + "' type='text' /></td></tr>";
                                    reStr += "<tr><td><input id='Button1' onClick=\"javascript:tphd(" + q.Id + ",'" + sp.DummyPaht + "')\"  type='button' value='我要回复' /></td></tr>";
                                }
                                else if (q.QuestionType == 3)
                                {
                                    string[] arrContent = q.QuestionDiscription.Split('|');
                                    int val = 0;
                                    foreach (string content in arrContent)
                                    {
                                        val = val + 1;
                                        string itemName = content.Split(',')[0];
                                        reStr += "<tr><td><input type=\"radio\"  id='dx' name='dx" + q.Id + "' value=\"" + val + "\">" + itemName + "</td></tr>";
                                    }
                                    reStr += "<tr><td><label style='cursor:hand' onClick=\"javascript:tptj(" + q.Id + ",'" + sp.DummyPaht + "')\" > <img alt='' src=\"images/button_img1.jpg\" border='0' /></label><label style='cursor:hand' onClick=\"javascript:tpck(" + q.Id + ",'" + sp.DummyPaht + "')\" > <img alt='' src=\"images/button_img2.jpg\" border='0' /></label></td></tr>";
                                }
                                else if (q.QuestionType == 4)
                                {
                                    string[] arrContent = q.QuestionDiscription.Split('|');
                                    int val = 0;
                                    foreach (string content in arrContent)
                                    {
                                        val = val + 1;
                                        string itemName = content.Split(',')[0];
                                        reStr += "<tr><td><input type=\"checkbox\" name=\"dxs" + q.Id + "\" value=\"" + val + "\">" + itemName + "</td></tr>";
                                    }
                                    reStr += "<tr><td><label style='cursor:hand' onClick=\"javascript:tpdx(" + q.Id + ",'" + sp.DummyPaht + "')\" > <img alt='' src=\"images/button_img1.jpg\" border='0' /></label><label style='cursor:hand' onClick=\"javascript:tpck(" + q.Id + ",'" + sp.DummyPaht + "')\" > <img alt='' src=\"images/button_img2.jpg\" border='0' /></label></td></tr>";
                                }
                                else if (q.QuestionType == 6)
                                {
                                    string[] arrContent = q.QuestionDiscription.Split('|');
                                    int val = 0;
                                    foreach (string content in arrContent)
                                    {
                                        val = val + 1;
                                        string itemName = content.Split(',')[0];
                                        reStr += "<tr><td><input type=\"radio\"  id='dx' name='sf" + q.Id + "' value=\"" + val + "\">" + itemName + "</td></tr>";
                                    }
                                    reStr += "<tr><td><label style='cursor:hand' onClick=\"javascript:tpsf(" + q.Id + ",'" + sp.DummyPaht + "')\" > <img alt='' src=\"images/button_img1.jpg\" border='0' /></label><label style='cursor:hand' onClick=\"javascript:tpck(" + q.Id + ",'" + sp.DummyPaht + "')\" > <img alt='' src=\"images/button_img2.jpg\"border='0' /></label></td></tr>";
                                }
                                reStr += "</table>";
                            }

                        }
                        break;
                    #endregion

                    #region 订单提交成功返回信息
                    case "OrderPayment":
                        string OrderId = ChangeHope.WebPage.PageRequest.GetQueryString("OrderId");
                        YXShop.BLL.Order.Orders ordbll = new YXShop.BLL.Order.Orders();
                        YXShop.Model.Order.Orders ordmodel = ordbll.GetModel(OrderId);
                        StringBuilder orderPaymentHtml = new StringBuilder();
                        if (ordmodel != null)
                        {
                            orderPaymentHtml.Append("<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" align=\"center\" border=\"0\">");
                            orderPaymentHtml.Append("<tbody>");
                            orderPaymentHtml.Append("<tr>");
                            orderPaymentHtml.Append("<td height=\"30\">恭喜，您的订单提交成功！</td>");
                            orderPaymentHtml.Append("</tr>");
                            orderPaymentHtml.Append("<tr>");
                            orderPaymentHtml.Append("<td height=\"30\">您的订单号为：<font color=\"#ff0000\"><strong>" + ordmodel.OrderId + "</strong></font></td>");
                            orderPaymentHtml.Append("</tr>");
                            orderPaymentHtml.Append(" <tr>");
                            orderPaymentHtml.Append("<td height=\"30\">请牢记您的订单号，以便查询订单付款状态及发货信息！</td>");
                            orderPaymentHtml.Append("</tr>");
                            orderPaymentHtml.Append("<tr>");
                            orderPaymentHtml.Append("<td height=\"30\">您需要支付的货款金额为：<font color=\"#ff0000\">" +Convert.ToDouble(ordmodel.FactPrice).ToString("f2") + "</font>&nbsp;&nbsp;元，货款金额含支付手续费：" + (double.Parse(ordmodel.FactPrice.ToString()) - double.Parse(ordmodel.TotalPrice.ToString())).ToString("f2") + "元；配送费："+ordmodel.Courier+"元。</td>");
                            orderPaymentHtml.Append("</tr>");
                            orderPaymentHtml.Append("<tr>");
                            string StrPayment = string.Empty;
                            string PaymentMode = string.Empty;
                            YXShop.BLL.SystemInfo.TerraceManage tmbll = new YXShop.BLL.SystemInfo.TerraceManage();
                            YXShop.Model.SystemInfo.TerraceManage tmmodel = tmbll.GetModelById(Convert.ToInt32(ordmodel.PaymentType));
                            if (tmmodel != null)
                            {
                                switch (tmmodel.Tmgarden)
                                {
                                    case 1://财付通
                                        PaymentMode = "财付通支付";
                                        StrPayment = "<a  target=\"_blank\" href=\"" + sp.DummyPaht + "onlinepayment/tenpay/md5_pay.aspx?MerchantId=" + tmmodel.Tmseller + "&MD5Key=" + tmmodel.Tmkey + "&&UserID=" + tmmodel.Tmaccount + "&OrdersID=" + ordmodel.OrderId + "&TotalPrice=" + Convert.ToDecimal(ordmodel.FactPrice).ToString("####.##") + "\"><img src='" + sp.DummyPaht + "images/yxs_cft.gif' border='0'></a>";
                                        break;
                                    case 2://支付宝
                                        PaymentMode = "支付宝支付";
                                        if (tmmodel.Porttype == "1")//标准双接口
                                        {
                                            StrPayment = "<a  target=\"_blank\" href=\"" + sp.DummyPaht + "onlinepayment/Alipay/Default.aspx?MerchantId=" + tmmodel.Tmseller + "&MD5Key=" + tmmodel.Tmkey + "&TotalPrice=" + Convert.ToDecimal(ordmodel.FactPrice).ToString("####.##") + "&UserID=" + tmmodel.Tmaccount + "&OrdersID=" + ordmodel.OrderId + "\"><img src='" + sp.DummyPaht + "images/yxs_zfb.gif' border='0'></a>";
                                        }
                                        else if (tmmodel.Porttype == "2")//担保交易接口
                                        {
                                            YXShop.BLL.SystemInfo.PostArea pbll = new YXShop.BLL.SystemInfo.PostArea();
                                            YXShop.Model.SystemInfo.PostArea pmodel = pbll.GetModelID(Convert.ToInt32(ordmodel.PaymentType));
                                            if (pmodel != null)
                                            {
                                                YXShop.BLL.Order.OrderProduct obll = new YXShop.BLL.Order.OrderProduct();
                                                DataTable dt = obll.GetListOrderProduct(ordmodel.Id.ToString());
                                                int productCount = 0;
                                                if (dt.Rows.Count > 0)
                                                {
                                                    for (int p = 0; p < dt.Rows.Count; p++)
                                                    {
                                                        productCount += Convert.ToInt32(dt.Rows[p]["ProNum"].ToString());
                                                    }
                                                }
                                                StrPayment = "<a  target=\"_blank\" href=\"" + sp.DummyPaht + "onlinepayment/Alipay2/alipaydefault.aspx?MerchantId=" + tmmodel.Tmseller + "&MD5Key=" + tmmodel.Tmkey + "&TotalPrice=" + Convert.ToDecimal(ordmodel.FactPrice).ToString("####.##") + "&UserID=" + tmmodel.Tmaccount + "&OrdersID=" + ordmodel.OrderId + "&DeliverMode=" + (pmodel == null ? "0" : pmodel.Deliverymode.ToString()) + "&ProdNum=" + productCount + "\"><img src='" + sp.DummyPaht + "images/yxs_zfb.gif' border='0'></a>";
                                            }
                                        }
                                        else//即时到帐交易接口
                                        {
                                            StrPayment = "<a  target=\"_blank\" href=\"" + sp.DummyPaht + "onlinepayment/Alipay3/Default3.aspx?MerchantId=" + tmmodel.Tmseller + "&MD5Key=" + tmmodel.Tmkey + "&TotalPrice=" + Convert.ToDecimal(ordmodel.FactPrice).ToString("####.##") + "&UserID=" + tmmodel.Tmaccount + "&OrdersID=" + ordmodel.OrderId + "\"><img src='" + sp.DummyPaht + "images/yxs_zfb.gif' border='0'></a>";
                                        }
                                        break;
                                    case 3://网银
                                        PaymentMode = "网银支付";
                                        StrPayment = "<a  target=\"_blank\" href=\"" + sp.DummyPaht + "onlinepayment/chinabank/Send.aspx?MerchantId=" + tmmodel.Tmseller + "&MD5Key=" + tmmodel.Tmkey + "&UserID=" + tmmodel.Tmaccount + "&TotalPrice=" + Convert.ToDecimal(ordmodel.FactPrice).ToString("####.##") + "&OrdersID=" + ordmodel.OrderId + "\"><img src='" + sp.DummyPaht + "images/chinabank.gif' border=0></a>";
                                        break;
                                    case 4://线下支付
                                        PaymentMode = "线下支付(请点击您要确认转账/存现的银行)";
                                        StringBuilder linePayment = new StringBuilder();
                                        StringBuilder sthmlB = new StringBuilder();
                                        YXShop.BLL.SystemInfo.BankAccount bibll = new YXShop.BLL.SystemInfo.BankAccount();
                                        ChangeHope.DataBase.DataByPage dbp = null;
                                        if (sp.IsPayMentWebOperation)
                                        {
                                            dbp = bibll.GetList(" [order by] bank_id asc ", 10, " and bank_putouttypeid=0");
                                        }
                                        else
                                        {
                                            string UserTypeId = ordmodel.SaleUserType;
                                            string UserId = ordmodel.SaleUserID;
                                            if (UserTypeId == "0")
                                            {
                                                dbp = bibll.GetList(" [order by] bank_id asc ", 10, " and bank_putouttypeid=0");
                                            }
                                            else
                                            {
                                                dbp = bibll.GetList(" [order by] bank_id asc ", 10, " and bank_putouttypeid=1 and bank_putoutID=" + UserId + "");
                                            }
                                        }
                                        linePayment.Append("<table class=\"PaymentOption\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">");
                                        linePayment.Append("<tr>");
                                        if (dbp.DataReader != null)
                                        {
                                            int c = 1;
                                            while (dbp.DataReader.Read())
                                            {
                                                linePayment.Append("<td>");
                                                string url = sp.DummyPaht + "images/NaughtImages.gif";
                                                if (!string.IsNullOrEmpty(dbp.DataReader["bank_icon"].ToString()))
                                                {
                                                    url = sp.DummyPaht + dbp.DataReader["bank_icon"].ToString();
                                                }
                                                linePayment.Append("<div class='bankPaymentOption'>");
                                                linePayment.Append("<ul>");
                                                linePayment.Append("<li><a href='" + sp.DummyPaht + "filehandle/dealwith_order_info.ashx?type=Downline&orderId=" + ordmodel.Id + "&bankId=" + dbp.DataReader["bank_id"].ToString() + "'><img src=\"" + url + "\" style=\"cursor:hand\" border=\"0\" width=\"142px\" height=\"43px\" /></a></li>");
                                                linePayment.Append("<li><span>帐号：</span>" + dbp.DataReader["bank_number"].ToString() + "</li>");
                                                linePayment.Append("<li><span>户名：</span>" + dbp.DataReader["bank_name"].ToString() + "</li>");
                                                linePayment.Append("</ul>");
                                                linePayment.Append("</div>");
                                                linePayment.Append("</td>");
                                                if (c % 4 == 0)
                                                {
                                                    linePayment.Append("</tr><tr>");
                                                }
                                                c++;
                                            }
                                        }
                                        else
                                        {
                                            linePayment.Append("<td>本站未设置银行支付，请联系本站客服，谢谢！</td>");
                                        }
                                        linePayment.Append("</tr>");
                                        linePayment.Append("</table>");
                                        StrPayment=linePayment.ToString();
                                        break;
                                    case 5://余额支付
                                        PaymentMode = "余额支付";
                                        StrPayment = "<div class=\"BalanceOfPayments\"><ul>";
                                        if (!string.IsNullOrEmpty(ordmodel.UserId))
                                        {
                                            YXShop.BLL.Member.MemberAccount mabll = new YXShop.BLL.Member.MemberAccount();
                                            YXShop.Model.Member.MemberAccount mamodel = mabll.GetModel(ordmodel.UserId);
                                            if (mamodel != null)
                                            {
                                                if (mamodel.Capital < ordmodel.FactPrice)
                                                {
                                                    StrPayment += "<li>您的余额不是，请登录会员中心进行支付，谢谢！</li>";
                                                    StrPayment += "<li><input type=\"button\" name=\"BalanceOfPayments_Ok\" id=\"BalanceOfPayments_Ok\" onclick=\"window.location.href='" + sp.DummyPaht + "membercenter/login.aspx'\" value=\"确认\" /></li>";

                                                }
                                                else
                                                {
                                                    StrPayment += "<li>您的订单金额：" + Convert.ToDouble(ordmodel.FactPrice).ToString("f2") + "元，账户余额：" + Convert.ToDouble(mamodel.Capital).ToString("f2") + "元</li>";
                                                    StrPayment += "<li><input type=\"button\" name=\"BalanceOfPayments_Ok1\" id=\"BalanceOfPayments_Ok1\" onclick=\"window.location.href='" + sp.DummyPaht + "filehandle/dealwith_order_info.ashx?type=BalanceOfPayments&orderId=" + ordmodel.Id + "&userName="+ordmodel.UserId+"&payMoney="+ordmodel.FactPrice+"&orderNo="+ordmodel.OrderId+"'\" value=\"确认支付\" /></li>";
                                                }
                                            }
                                        }
                                        else
                                        {
                                            StrPayment += "<li>您是匪名用户（非会员）购买该商品，请登录会员中心进行支付，谢谢！</li>";
                                            StrPayment += "<li><input type=\"button\" name=\"BalanceOfPayments_Ok\" id=\"BalanceOfPayments_Ok\" onclick=\"window.location.href='" + sp.DummyPaht + "membercenter/login.aspx'\" value=\"确认\" /></li>";
                                        }
                                        StrPayment += "</ul></div>";
                                        break;
                                }
                            }
                            orderPaymentHtml.Append("<td height=\"30\">支付方式：" + PaymentMode + "</td>");
                            orderPaymentHtml.Append("</tr>");
                            orderPaymentHtml.Append("<tr>");
                            orderPaymentHtml.Append("<td>" + StrPayment + "</td>");
                            orderPaymentHtml.Append("</tr>");
                            orderPaymentHtml.Append("<tr><td><span style=\"font-weight:bold;font-size:14px\">还差一步，请尽快付款，付款后请务必进入订单中心填写付款确认</span></td></tr>");
                            orderPaymentHtml.Append("</tbody>");
                            orderPaymentHtml.Append("</table>");
                            reStr = orderPaymentHtml.ToString();
                        }
                        else
                        {
                            reStr = "订单生成失败!";
                        }
                        break;
                    #endregion

                    #region 热门搜索词
                    case "TopSearches":
                        YXShop.BLL.Accessories.Top_Searches tsdata = new YXShop.BLL.Accessories.Top_Searches();
                        ChangeHope.DataBase.DataByPage tsdataPage = tsdata.GetList("[order by] sort asc", 20, " and isshow=1");
                        //添加表的内容
                        if (tsdataPage.DataReader != null)
                        {
                            while (tsdataPage.DataReader.Read())
                            {
                                reStr += "<a href='" + sp.DummyPaht + "product/productsearchlist.aspx?q_proname=" + tsdataPage.DataReader["name"].ToString() + "'>" + tsdataPage.DataReader["name"].ToString() + "</a>&nbsp;| &nbsp;";
                            }
                        }
                        break;
                    #endregion

                }
            }
            return reStr;
        }
    }
}
